package com.mtsmda.preparationforjavainterview.jinterview;

public class ClassGoTO {

	private static char sameChar;

	public static boolean hasSameLetter(String firstWorld, String secondWorld) {
		boolean same = false;
		outer:
		for(int i = 0; i < firstWorld.length(); i++){
			for(int j = 0; j < secondWorld.length(); j++){
				if(firstWorld.charAt(i) == secondWorld.charAt(j)){
					same = true;
					System.out.println("Same char is - " + firstWorld.charAt(i));
					sameChar = firstWorld.charAt(i);
					break outer; 
				}
			}
		}
		return same;
	}

	public static char getSameChar() {
		return sameChar;
	}

}